package com.dream.house.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.com.servyou.base.exception.DAOException;

import com.dream.house.dao.base.IDAO;
import com.dream.house.entity.RoomDTO;

/**
 * 房源信息-房信息DAO接口
 * @author ahk
 * @since 1.0
 */
@Repository
public interface RoomDAO extends IDAO{
	
	boolean saveRoom(RoomDTO dto) throws DAOException;
	
	boolean updateRoom(RoomDTO dto) throws DAOException;
	
	boolean removeRoom(String room_id) throws DAOException;
	
	boolean removeRecord(String room_id) throws DAOException;
	
	List<RoomDTO> findRooms(RoomDTO dto) throws DAOException;
	
	List<RoomDTO> findRoomsWithBuyRent(RoomDTO dto) throws DAOException;
	
	RoomDTO getRoom(String id) throws DAOException;
	
	RoomDTO getRoomDetail(String id) throws DAOException;
	
	/**
	 * 更新房子使用状态<br>
	 * 1、买房审批通过后，需要把房子的使用状态设置为已买；1-已购买<br>
	 * 2、租房审批通过后，需要把房子的使用状态设置为已租；2-已租赁<br>
	 * 3、退房审批通过后，需要把房子的使用状态设置为未使用；0-未使用<br>
	 * @param id
	 * @param status
	 * @return
	 * @throws DAOException
	 */
	boolean updateUseStatus(String id,String status) throws DAOException;
	
	/**
	 * 房子锁定，更新房子审核状态为：5-入库锁定
	 * @param id
	 * @return boolean
	 * @throws DAOException
	 */
	boolean locked(String id) throws DAOException;
	
	/**
	 * 房子解锁,解锁后房子状态为:9-已入库
	 * @param id
	 * @return
	 * @throws DAOException
	 */
	boolean unLocked(String id) throws DAOException;
}
